package com.mz.mattress.admin.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mz.mattress.admin.api.req.MemberMerQueryReq;
import com.mz.mattress.admin.api.resp.MemberMerType;
import com.mz.mattress.api.common.Result;
import com.mz.mattress.api.entity.MemberMer;
import com.mz.mattress.api.req.BindMobileReq;
import com.mz.mattress.api.req.MobileLoginReq;
import com.mz.mattress.api.req.UpdatePasswordReq;
import com.mz.mattress.api.req.WxLoginReq;
import com.mz.mattress.api.resp.UserAuth;

public interface MemberMerService {


    Result<IPage<MemberMer>> listPage(MemberMerQueryReq req);

    /**
     * 微信登陆或注册
     * @param req
     * @return
     */
    Result<UserAuth> wxLogin(WxLoginReq req);

    //手机号 密码登陆
    Result<UserAuth> mobileLogin(MobileLoginReq req);

    /**
     * 提取微信绑定的手机号
     * @param data
     * @return
     */
    Result<UserAuth> bindWxMobile(String sessionkey, String data, Long memberId);

    /**
     * 切换门店 重新生成TOKEN
     * @param memberId
     * @return
     */
//    Result<String> switchMerchantCreateToken(String mobile, Integer merchantId, Long memberId);
    @Deprecated
    /**
     * 通过短信验证码绑定手机号
     * @param req
     * @param memberId
     * @return
     */
    Result<UserAuth> bindMobile(BindMobileReq req, Long memberId);

    Result<MemberMer> getById(Long id);

    Result deleteById(Long id);

//    Pair<Integer, Integer> findTypeId(Integer type, Long memberId, String mobile);


    MemberMerType findTypeId(Integer type, Long memberId, String mobile);

    /**
     * 提现
     * @param memberId
     * @param cashId   提现请求号
     * @param money
     * @return
     */
    Result cashOut(Long memberId, String cashId, Integer money);

    /**
     * 清空会员角色
     * @param memberId
     * @return
     */
    Result resetType(Long memberId);

    //重置密码
    Result resetPassword(Long memberId);

    Result updatePassword(UpdatePasswordReq req);

}
